perm filename XGPSYN.HPM[UP,DOC]4 blob sn#552242 filedate 1980-12-17 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00006 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	XGPSYN
C00006 00003	XGPSYG
C00012 00004	SWITCHES
C00019 00005	Zen and the art of using the Varian to make XGP-like listings
C00023 00006	Making extra large pages with XGPSYN and XGPSYG
C00028 ENDMK
C⊗;
XGPSYN

	XGPSYN displays files on the video synthesizer, imitating the XGP.
It can fill the screen with 1/2, 1 or 2 pages at time. XGPSYN can also
list documents on the XGP, with no complexity limit, and make hand/eye
compatible picture files which can be sent to printers like the VARIAN, or
displayed on screens. XGPSYG has the added capability of inserting
drawings and pictures into the assembled pages.


	To run the programs, tell them which file you want to look at,
either in the command line (R XGPSYN;FILENAME) or in answer to the FILE:
question, and any spooler style switches, such as /FONT=BASL30 (.XGP files
already contain most necessary switches).  The page number questions can be
answered with the page you want to view, any additional spooler switches,
or one of the following commands:

H        Half density. Next display will be 1/2 page/screen.
F        Full density. 1 page/screen.
D        Double density. 2 pages/screen.

C        display on your own DD channel instead of video synthesizer
S        use video synthesizer instead of own channel

V        view. Redraw the last display.
W        negate subsequent displays. B/W → W/B and W/B → B/W.
K        kill. Erase the synthesizer.
Q        quit. Exit program and load line editor with XS command.

L(a:b)   list pages a thru b on the XGP. Slower, more tolerant than XSPOOL.

B        Bitwise resolution. Next display will be suitable for XGPing.
T        Transposed bitwise resolution. Sideways B.
E        Enormous resolution. Next display can be sent expanded to XGP.

O        output the last display as a data compressed picture file.
P        output the last display as a standard hand/eye picture file.
X        XGP output the last B,T or E display.

	The video synthesizer is a video rate D/A driven by data disc
channels 30 through 37. H density requires 3 of these channels, F needs 4
and D wants 5. These are rarely available during heavy system load. It
takes about 6 CPU seconds to compose a single page.

XGPSYG

	XGPSYG is an extended version of XGPSYN which permits inclusion in
displayed or listed documents of "GOD" graphics files produced with the
GRAHDR.SAI[GOD,HPM] package, or Leland Smith format music files, or gray
scale pictures stored in hand/eye format files

GOD Files and XGPSYG

	The following program writes the GOD file that produced Figure
10-1 in Chapter 10 of Hans Moravec's thesis. Some clue as to its operation
may be obtained by reading GUIDE.GRA[GRA,HPM].

BEGIN "PRETTY"
REQUIRE "TYPHDR.SAI[GOD,HPM]" SOURCE_FILE;

INTEGER FJ,I,J,K,L,M,N; REAL P,Q;
REAL ARRAY X,Y[1:10];

FJ←FILJOB("DSK:PRETTY.GOD[DIA,HPM]"); comment Create the GOD file;

DDINIT; SCREEN(-1.2,-1.2,1.2,1.2);  comment initialize display buffer;

PICFIL(-1,-1,1,1,"U:SF2.PIC[DIA,HPM]"); LITEN; comment insert a gray scale picture;
LINE(-1,-1,-1,1); LINE(1,1,-1,1);      comment draw a border around it;
LINE(1,1,1,-1);   LINE(-1,-1,1,-1);

FNTSELECT(2,"METMBM"); FNTSELECT(3,"METSBM");  comment select some fonts;
FNTSELECT(103,"BASL30");

FNTPOS(-1,1.03,1,1,0,0);		       comment write in font 2;
FNTEXT(0,0,2,"See the pretty aeroplane");

DRKEN;
   BEGIN REAL ARRAY X,Y[1:20]; INTEGER I;      comment draw a balloon;
   FOR I←1 STEP 1 UNTIL 20 DO
     BEGIN X[I]←.89+0.304*COS((I-1)*2*3.14159/20);
     Y[I]←.5+0.12*SIN((I-1)*2*3.14159/20); END;
   X[12]←.62; Y[12]←-.23;
   POLYGO(20,X[1],Y[1]);
   LITEN;
   FOR I←1 STEP 1 UNTIL 20 DO
      LINE(X[I],Y[I],X[(I MOD 20)+1],Y[(I MOD 20)+1],3);
   END;

FNTPOS(.89,.5);		comment write into the balloon in font 3;
DEPOSIT(0,0,CENTER(JTXT(3,"Yow !!!  I am an L1011 !!")));

DPYUP(-1); KILJOB(FJ);  comment close the GOD file;
END;

	The GOD file contains graphics commands like line, dot, text,
picture etc. When PRETTY.SAI says LINE(...) a line command gets written
into PRETTY.GOD. When it says PICFIL(..., ``SF1.PIC'') a binary rendition
of the command gets written into the file.  It is the job of whatever
program reads PRETTY.GOD to deposit the picture when it encounters the
PICFIL command in it, just like it's its responsibility to draw a line
when it sees a LINE command.

	You can insert a .GOD file into as document with XGPSYG by
including a line of the form

		  ⊂⊗⊃G[0,.5](5,4):PRETTY.GOD[GOD,HPM]⊂⊗⊃

in your document text.

	This  means 

	    Here is an escape! ⊂⊗⊃

	    its a GOD file escape  "G" (alternatives are P for a gray scale
					picture and L for a music score file)

	    put diagram's center diagram 0 inches right and
	    0.5 inches above the page center "[0, .5]"

	    the diagram is to be 5 inches wide by 4 inches high "(5, 4)"

	    get your graphics commands from the file PRETTY.GOD[DIA,HPM]

	    Here is the end of the escape! ⊂⊗⊃

	The position field in square brackets and the size field in parens
are optional. If left out, the picture will be centered around where your
escape text would have appeared if you had XSPOOLED'd or XGPSYN'ed your
document. An alternative form for the position field is [%-2.3,%+3.7],
which means the center of the diagram is to be put 2.3 inches to the left
and 3.7 inches above where your escape sequence would have been deposited.
Thus you can position diagrams on the page either absolutely, or relative
to the position of the escape sequence.  This allows you to, for example,
center your diagram using a text processors text centering features.  It
is ok to make the X position, say, relative and the Y position absolute.
SWITCHES

	XGPSYN and XGPSYG understand the following switches, some of which
are not standard with the spooler or the COPY program. The switch names
may be abbreviated to the capitalized portion.


/FONT="fontname"
	Select font number 0 for the document.

/FONT$\#$n="fontname"
	Select font number n for the document.

/THickness=t
	Select line thickness for Leland's music files.

/ESCape=...
	change the escape sequence. Any characters except slash are ok.

/REpeat=n
	When listing, make n copies of each page.

/TMar=n
	Set the top margin of a listing n raster lines from top of page.

/PMar=n
	Set the text portion of the page to be n lines tall.

/BMar=n
	Make the bottom margin n raster lines big. In listings the sum of
TMAR+PMAR+BMAR is the physical length of the page.

/LMar=n
	Set the left margin n pixels from left edge of paper.

/RMar=n
	Set the right margin n pixels from the left edge of the paper.
When writing picture files of page images, RMAR is the physical width of
the resulting image.

/List
	List the document on the XGP. Possible forms are /L to list the
whole document, /L(n) to list page n and /L(a:b) to list all the pages
between a and b. The simplest way to list a document with XGPSYN is by
incanting R XGPSYN;file/L.

/XLine=n
	Insert n extra scanlines between lines of text. This number is
initially 3.

/INterchar=n
	Insert n extra columns between characters of text.  This number is
usually zero.

/XShift=n
	Shift the contents of a page n pixels to the right on the image.
Useful if you want to tweak the margins in a listing, and also for making
images too large to fit in XGPSYN's core image all at once.  Set RMAR
small, the output the same page repeatedly with different XSHIFTS.
Resulting windows can be combined later into a single file representing a
large page.

/YShift=n
	Shift the page contents n pixels up. For tweaking vertical
margins, and also for making very long pages. Set TMAR+PMAR+BMAR small,
then window through the file by changing YSHIFT. If resulting windows are
to be assembled later the EDGE switch is also recommended.

/EDge
	Normally characters that extend past the top margin of a page are
not displayed. /EDGE selects a slower mode in which such fractional
characters do appear. This is necessary if large pages are to be assembled
from small windows.

/XGp
	This file is in .XGP format, whether or not the file extension
says so.

/NOXgp
	This file is not in .XGP form (is not preceded by a switch page).

/NOQueue
	When listing on the XGP, XGPSYN will create a detached job which
waits if the XGP is not available when a page is to be generated.  NOQUEUE
supresses this feature. Instead, XGPSYN itself waits for the XGP.

/NODpy
	Supresses video synthesizer display. Useful if XGPSYN is being
used soley to generate files containing page images. /L invokes this mode
automatically.

/AUTocr
	Insert carriage returns when lines run beyond right margin.

/NOAutocr
	Suppress insertion of extra carriage returns.

/Halfdensity
	Select half page/screen mode.

/Fulldensity
	Select full page/screen mode.

/Doubledensity
	Select two page/screen mode.

/Enormousresolution
	In this mode a screenful of display is generated without any
compression of the original page raster. Very little of a standard page is
visible, but every pixel can be resolved in that portion.

/Bitwisedensity
	Create a one bit/pixel image of the whole page.  This can be sent
to the XGP (/L uses this density) or written into a hand-eye picture file.
Such files can be listed on other printing devices.

/Transposedbitwisedensity
	Like /B, but the image comes out on its side, rotated 90 degrees.

/Varian
	Useful only with XGPSYG. Causes halftones to be generated in a
high density mode which works well with the Varian printer, but causes
washing out on the XGP.

Zen and the art of using the Varian to make XGP-like listings


First: calm your mind - the ordeal is long and painful,
       but in the end you will triumph


Second: Prepare your .XGP file in the usual manner


Third: incant (your typein is in upper case):

        R XGPSYN;FILE.XGP/B/NODPY        (file.xgp is your file)
        page #:1
        page #:O
        output file name:P1
        page #:2
        page #:O
        output file name:P2
        page #:3
        page #:O
        output file name:P3

       (and so on, until the last page is done. XGPSYN types out the page
        number of the page just processed for all pages but the last. When it
        fails to type out a page number, you know the last page has been done.)

        page #:Q      (this terminates XGPSYN)


Fourth: incant:

	R VAR2P
	file 1:P1
	file 2:P2
	output file:P12.VRN
        file 1:P3
        file 2:P4
	output file:P34.VRN

        (and so on until the last file is processed. If you had an odd
	 number of pages, repeat your favorite one twice, since the
	 input is pairwise.  Also check the disk space available as you
	 run this program; it makes HUGE files.  If disk is about to
	 run out, stop.  You can do the first few pages in one batch,
	 then delete the files, and do other batches later).

         ↑C         (this terminates VAR2P)

Fifth:	incant

	R VARIAN
	outline:1
	file:P12
	file:P34
 	file:P56
        
	(and so on, for a maximum of 15 page pairs. You'll have used up
         all the available disk before getting to 15 pairs (=30 pages)
	 anyway, so don't worry about the limit. end the input with a
	 blank line)

        file:       (carriage return activates VARIAN; your listing should
			start coming out)


Sixth:	Check for any spoiled pages. You can run VARIAN again to get
	extra copies without all the preceding effort.


Seventh: When you are satisfied with your listing, delete the files
	 P1, P2, P3, etc and, especially P12.VRN, P34.VRN, ... .
	 They are truly gigantic.

Eighth:  Using scissors and the paper knife, cut the pages along
	 the thin lines. The paper knife is good for the final
	 cuts, but scissors are needed to roughly trim to pages
	 to a size that can be handled by the knife.

Ninth:  Breathe a sigh of relief.
Making extra large pages with XGPSYN and XGPSYG

	When XGPSYN is used to list pages of files on the XGP or
Varian, the default page size is 8.5 inches (1700 pixels) wide by 11
inches (2200 pixels) long.

	The physical page width is controlled by the RMAR switch.  For
instance, adding /RMAR=1900 after the file name will give a page width
of 9.5 inches on the Varian (not on the XGP, of course; its paper being
only 8.5 inches wide).

	The page length is controlled by the TMAR, PMAR and BMAR
switches.  TMAR is the margin at the top of the printed portion of the
page, PMAR is the window for printing and BMAR is the bottom margin.
Files containing .XGP y selects can write into the top and bottom
margins, but in all cases the physical page length is the sum of the
values of the three switches.  The defaults are
/TMAR=100/PMAR=2000/BMAR=100, for a total of 2200 pixels.  Pages can be
shortened or lengthened by adjusting any of the three switches.
Changing PMAR is most esthetic.  XGPSYN and its smarter sibling do not
support indefinite page lengths (PMAR=0, which TEX uses).  You can
override the /PMAR=0 in a file with an explicit /PMAR switch, which
will determine the size of the pages (along with BMAR and TMAR).

	Because the whole page being assembled resides in the XGPSYN
core image, there is a size limit.  Currently the area of the assembled
page cannot exceed about 1.4 times the area of the 8.5 by 11 default.
If you attempt to exceed the limits, XGPSYN will crash in various
obscure ways because of bugs in SAIL's out of core detector when the
core image is bigger than 128K.

	It is possible to trade off length for width; for instance the
switch settings /RMAR=3400/TMAR=50/PMAR=1000/BMAR=50 will generate a
page twice as wide and half as tall as usual.

	It is possible to generate much larger pages in small pieces.  I
will demonstrate the idea by giving a concrete example, making a page
of standard length and twice standard width.

R XGPSYN;File/RMAR=3400/TMAR=50/PMAR=1000/BMAR=50/EDGE/NODPY/B
Page #:1	make page one. because of T,P and BMAR we get only top 5.5 in
Page #:O	output it to file P1A.VRN (O means data-compressed. This
File:P1A.VRN	  saves disk space, but P is safer if load is high)
Page #:/YSHIFT=-1100   offsets subsequent pages by 5.5 inches
Page #:1	so now page 1 gives 5.5 inches below bottom
Page #:O	of first window.
File:P1B.VRN
Page:Q		quit. If one wanted to do another 5.5 inch swath,
		the command would have been /YSHIFT=-2200

R VARIAN
Outline? 2
File:P1A
File:P1B
File:

	The /NODPY switch suppresses unnecessary synthesizer display of
portions of the assembled pages.  The /EDGE switch makes letters that
straddle the boundary of the 5.5 inch swaths come out right.  It slows
the program down a little.  /B selects binary mode, which is what you
need for things sent to the XGP or Varian.